package com.qo.qsdk.param;

import android.os.Parcel;
import android.os.Parcelable;

public class GameRoleParams implements Parcelable {

    public static final int DataType_RoleCreate = 1;
    public static final int DataType_RoleLogin = 2;
    public static final int DataType_PurchaseFirst = 3;//首充調用
    public static final int DataType_PurchaseMax = 4;//第一次調用最大檔位充值調用
    public static final int DataType_JoinGangs = 5;//加入家族
    public static final int DataType_FinishGuide = 6;//完成新手引導
    public static final int DataType_ClickStore = 7;//查看充值商店
    public static final int DataType_AddFriends = 8;//添加好友
    public static final int DataType_AcceptFriends = 9;//通過好友
    public static final int DataType_RoleLevel = 10;//角色升級
    public static final int DataType_GameTime = 11;//在線時長
    public static final int DataType_Purchase = 12;

    private int dataType;
    private String serverId;//玩家所在服务器的ID
    private String serverName;//玩家所在服务器的名称
    private String roleId;//玩家角色ID
    private String roleName;//玩家角色名称
    private String roleLevel;//玩家角色等级
    private String moneyNum;//当前角色身上拥有的游戏币数量
    private long roleCreateTime;//角色创建时间，从1970年到现在的时间，单位秒
    private long roleLevelUpTime;//角色等级变化时间，从1970年到现在的时间，单位秒
    private long onlineTime;//在線時長，單位秒
    private String vip;//玩家VIP等级
    private String power;//玩家战力，没有不传
    private int roleGender;//玩家性别，0：男；1：女 2:未知
    private String partyId;//玩家公会ID，没有不传
    private String partyName;//玩家公会名称，没有不传
    private String professionId;//玩家职业ID， 没有不传
    private String professionName;//玩家职业名称，没有不传

    private String type;

    public GameRoleParams() {
        dataType = 0;
        serverId = "";
        serverName = "";
        roleId = "";
        roleName = "";
        roleLevel = "";
        moneyNum = "";
        roleCreateTime = 0;
        roleLevelUpTime = 0;
        onlineTime = 0;
        vip = "";
        power = "";
        roleGender = 2;
        partyId = "";
        partyName = "";
        professionId = "";
        professionName = "";
        type = "";
    }

    protected GameRoleParams(Parcel in) {
        dataType = in.readInt();
        serverId = in.readString();
        serverName = in.readString();
        roleId = in.readString();
        roleName = in.readString();
        roleLevel = in.readString();
        moneyNum = in.readString();
        roleCreateTime = in.readLong();
        roleLevelUpTime = in.readLong();
        onlineTime = in.readLong();
        vip = in.readString();
        power = in.readString();
        partyId = in.readString();
        roleGender = in.readInt();
        partyName = in.readString();
        professionId = in.readString();
        professionName = in.readString();
        type = in.readString();
    }

    public static final Creator<GameRoleParams> CREATOR = new Creator<GameRoleParams>() {
        @Override
        public GameRoleParams createFromParcel(Parcel in) {
            return new GameRoleParams(in);
        }

        @Override
        public GameRoleParams[] newArray(int size) {
            return new GameRoleParams[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(dataType);
        dest.writeString(serverId);
        dest.writeString(serverName);
        dest.writeString(roleId);
        dest.writeString(roleName);
        dest.writeString(roleLevel);
        dest.writeString(moneyNum);
        dest.writeString(vip);
        dest.writeString(power);
        dest.writeString(partyId);
        dest.writeInt(roleGender);
        dest.writeString(partyName);
        dest.writeString(professionId);
        dest.writeString(professionName);
        dest.writeLong(roleCreateTime);
        dest.writeLong(roleLevelUpTime);
        dest.writeLong(onlineTime);
        dest.writeString(type);
    }

    public int getDataType() {
        return dataType;
    }

    public void setDataType(int dataType) {
        this.dataType = dataType;
    }

    public String getServerId() {
        return serverId == null ? "" : serverId;
    }

    public void setServerId(String serverId) {
        this.serverId = serverId;
    }

    public String getServerName() {
        return serverName == null ? "" : serverName;
    }

    public void setServerName(String serverName) {
        this.serverName = serverName;
    }

    public String getRoleId() {
        return roleId == null ? "" : roleId;
    }

    public long getOnlineTime() {
        return onlineTime;
    }

    public void setOnlineTime(long onlineTime) {
        this.onlineTime = onlineTime;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    public String getRoleName() {
        return roleName == null ? "" : roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public String getRoleLevel() {
        return roleLevel == null || roleLevel.length() == 0? "0" : roleLevel;
    }

    public void setRoleLevel(String roleLevel) {
        this.roleLevel = roleLevel;
    }

    public String getMoneyNum() {
        return moneyNum == null || moneyNum.length() == 0 ? "0" : moneyNum;
    }

    public void setMoneyNum(String moneyNum) {
        this.moneyNum = moneyNum;
    }

    public long getRoleCreateTime() {
        return roleCreateTime;
    }

    public void setRoleCreateTime(long roleCreateTime) {
        this.roleCreateTime = roleCreateTime;
    }

    public long getRoleLevelUpTime() {
        return roleLevelUpTime;
    }

    public void setRoleLevelUpTime(long roleLevelUpTime) {
        this.roleLevelUpTime = roleLevelUpTime;
    }

    public String getVip() {
        return vip == null || vip.length() == 0 ? "" : vip;
    }

    public void setVip(String vip) {
        this.vip = vip;
    }

    public String getPower() {
        return power == null || power.length() == 0 ? "0" : power;
    }

    public void setPower(String power) {
        this.power = power;
    }

    public int getRoleGender() {
        return roleGender;
    }

    public void setRoleGender(int roleGender) {
        this.roleGender = roleGender;
    }

    public String getPartyId() {
        return partyId == null ? "" : partyId;
    }

    public void setPartyId(String partyID) {
        this.partyId = partyID;
    }

    public String getPartyName() {
        return partyName == null ? "" : partyName;
    }

    public void setPartyName(String partyName) {
        this.partyName = partyName;
    }

    public String getProfessionId() {
        return professionId == null ? "" : professionId;
    }

    public void setProfessionId(String professionID) {
        this.professionId = professionID;
    }

    public String getProfessionName() {
        return professionName == null ? "" : professionName;
    }

    public void setProfessionName(String professionName) {
        this.professionName = professionName;
    }

    public void setType(String type) {
        this.type = type;
    }
}

